unit unDataCard;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, cxGraphics, cxControls, cxLookAndFeels, cxLookAndFeelPainters,
  cxContainer, cxEdit, dxSkinsCore, dxSkinBlack, dxSkinBlue, dxSkinCaramel,
  dxSkinCoffee, dxSkinDarkRoom, dxSkinDarkSide, dxSkinFoggy, dxSkinGlassOceans,
  dxSkiniMaginary, dxSkinLilian, dxSkinLiquidSky, dxSkinLondonLiquidSky,
  dxSkinMcSkin, dxSkinMoneyTwins, dxSkinOffice2007Black, dxSkinOffice2007Blue,
  dxSkinOffice2007Green, dxSkinOffice2007Pink, dxSkinOffice2007Silver,
  dxSkinPumpkin, dxSkinSeven, dxSkinSharp, dxSkinSilver, dxSkinSpringTime,
  dxSkinStardust, dxSkinSummer2008, dxSkinsDefaultPainters, dxSkinValentine,
  dxSkinXmas2008Blue, dxSkinsdxBarPainter, DB, dxBar, cxClasses, cxGroupBox,
  ToolWin, ComCtrls;

type
  TfrmDataCard = class(TForm)
    cxGroupBox1: TcxGroupBox;
    DataSource1: TDataSource;
    ToolBar1: TToolBar;
    procedure FormCreate(Sender: TObject);
    procedure btnPriorClick(Sender: TObject);
    procedure btnNextClick(Sender: TObject);
  private
    { Private declarations }
    procedure SetDataSet(const Value:TDataSet);
  public
    { Public declarations }
  public
    property DataSet :TDataSet write SetDataSet;
  end;


implementation

{$R *.dfm}

{ TfrmDataCard }

procedure TfrmDataCard.btnNextClick(Sender: TObject);
begin
  if not DataSource1.DataSet.Eof then
    DataSource1.DataSet.Next;
end;

procedure TfrmDataCard.btnPriorClick(Sender: TObject);
begin
  if not DataSource1.DataSet.Bof then
    DataSource1.DataSet.Prior;
end;

procedure TfrmDataCard.FormCreate(Sender: TObject);
begin
  Top:=trunc(screen.DesktopHeight / 2)-trunc(self.Height / 2);
  Left:=trunc(screen.DesktopWidth / 2)-trunc(self.Width / 2);
end;

procedure TfrmDataCard.SetDataSet(const Value: TDataSet);
begin
  DataSource1.DataSet:=Value;
end;

end.
